import request from '@utils/request'

// 登录
export function login (data) {
  return request({
    url: '/merchantAdmin/auth',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 修改密码
export function changePass (data) {
  return request({
    url: '/merchantAdmin/changePassWord',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token')
    }
  })
}

// 退出登录
export function quit (data) {
  return request({
    url: '/merchantAdmin/logOut',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token')
    }
  })
}

// 微信登录
export function WXLogin (data) {
  return request({
    url: '/merchantAdmin/wxAuth',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}

// 微信登录绑定账号
export function WXLoginBindUserNumber (data) {
  return request({
    url: '/merchantAdmin/bindUserNumber',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    }
  })
}